package com.macaline.controller.base;

import com.macaline.bean.PageVo;
import com.macaline.bean.Result;
import com.macaline.service.base.BaseService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;

/**
 * controller父类
 */
public abstract class BaseController<T> {

	public abstract BaseService<T> getService();

	@ResponseBody
	@PostMapping("/getById")
	public Result getById(String id){
		return Result.success(getService().getById(id));
	}

	@ResponseBody
	@PostMapping("/getList")
	public Result getList(@RequestBody PageVo vo){
		return Result.success(getService().getList(vo));
	}

}
